package com.chif.goingplus.service;

import com.chif.goingplus.dao.BusMapper;
import com.chif.goingplus.pojo.Bus;
import com.chif.goingplus.pojo.Stock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusServiceImpl implements BusService {

    @Autowired
    private BusMapper busMapper;

    @Override
    public int addBus(Bus bus) {
        busMapper.addBus(bus);
        return bus.getBid();
    }

    @Override
    public int deleteBusById(int id) {
        return busMapper.deleteBusById(id);
    }

    @Override
    public int updateBus(Bus bus) {
        return busMapper.updateBus(bus);
    }

    @Override
    public Bus queryBusById(int id) {
        return busMapper.queryBusById(id);
    }

    @Override
    public List<Bus> queryAllBus() {
        return busMapper.queryAllBus();
    }

    @Override
    public List<Stock> queryAllLoad() {
        return busMapper.queryAllLoad();
    }
}
